package com.beiye.drivertransport.safelearn;

import android.content.Context;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.PopupWindow;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.alibaba.fastjson.JSON;
import com.beiye.drivertransport.R;
import com.beiye.drivertransport.SubActivity.SignActivity;
import com.beiye.drivertransport.activity.TwoBaseAty;
import com.beiye.drivertransport.adapter.ListBaseAdapter;
import com.beiye.drivertransport.adapter.SuperViewHolder;
import com.beiye.drivertransport.bean.DailyPriceBean;
import com.beiye.drivertransport.bean.LoginUserBean;
import com.beiye.drivertransport.bean.SpecifiedLearnIngHomeBean;
import com.beiye.drivertransport.bean.TrainingIndvPriceFindBean;
import com.beiye.drivertransport.bean.UserVipCheckBean;
import com.beiye.drivertransport.config.AppInterfaceConfig;
import com.beiye.drivertransport.http.Login;
import com.beiye.drivertransport.utils.HelpUtil;
import com.beiye.drivertransport.utils.LogUtils;
import com.beiye.drivertransport.utils.TiShiDialog;
import com.beiye.drivertransport.utils.UserManger;
import com.beiye.drivertransport.utils.Utils;
import com.beiye.drivertransport.utils.WechatShareManager;
import com.bumptech.glide.Glide;
import com.githang.statusbar.StatusBarCompat;
import com.github.jdsjlzx.interfaces.OnLoadMoreListener;
import com.github.jdsjlzx.interfaces.OnRefreshListener;
import com.github.jdsjlzx.recyclerview.LRecyclerView;
import com.github.jdsjlzx.recyclerview.LRecyclerViewAdapter;

import org.json.JSONException;
import org.json.JSONObject;
import org.xutils.common.Callback;
import org.xutils.http.RequestParams;
import org.xutils.x;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;


import okhttp3.Call;
import okhttp3.Response;

//驾驶员日常培训计划列表
public class SpecifiedLearningHomeActivity extends TwoBaseAty {


    ImageView img_safeback;

    LRecyclerView lv_specified;

    View empty_view;

    TextView tv_company;

    TextView tv_name;
    private int firstIndex = 1;
    private int pageSize = 15;


    private SpecifiedLearningHomeApt specifiedLearningHomeApt;
    private LRecyclerViewAdapter lRecyclerViewAdapter1;
    ArrayList<SpecifiedLearnIngHomeBean.RowsBean> specifielist = new ArrayList<>();
    ArrayList<SpecifiedLearnIngHomeBean.RowsBean> specifielist1 = new ArrayList<>();
    private List<SpecifiedLearnIngHomeBean.RowsBean> rowList;
    private Bitmap bitmap;

    private int otpSn;
    private int qnSn; //问卷序列号
    private boolean buyMember; //是否能购买会员
    private String userId;
    private String orgId;
    private String orgName;

    @Override
    public int getLayoutId() {
        return R.layout.activity_specified_learning_home;

    }

    public void onClick(View view) {
        if (view.getId() == R.id.img_safeback) {
            finish();
        }
    }

    @Override
    public void initData() {
        img_safeback = (ImageView) findViewById(R.id.img_safeback);
        lv_specified = (LRecyclerView) findViewById(R.id.listview_message);
        empty_view = (View) findViewById(R.id.empty_view);
        tv_company = (TextView) findViewById(R.id.tv_company);
        tv_name = (TextView) findViewById(R.id.tv_name);
        StatusBarCompat.setStatusBarColor(this, Color.parseColor("#1F80C4"));
        bitmap = HelpUtil.getBitmap(this, R.drawable.logo_share);
        initUi();

    }

    private void initUi() {
        LinearLayoutManager ms = new LinearLayoutManager(SpecifiedLearningHomeActivity.this);
        ms.setOrientation(LinearLayoutManager.VERTICAL);
        lv_specified.setLayoutManager(ms);
        specifiedLearningHomeApt = new SpecifiedLearningHomeApt(SpecifiedLearningHomeActivity.this);
        lRecyclerViewAdapter1 = new LRecyclerViewAdapter(specifiedLearningHomeApt);
        lv_specified.setAdapter(lRecyclerViewAdapter1);
        lv_specified.setFooterViewColor(R.color.colorAccent, R.color.dark, android.R.color.white);
        lv_specified.setFooterViewHint("拼命加载中", "已经全部为你呈现了", "网络不给力啊，点击再试一次吧");
        lv_specified.setOnRefreshListener(new OnRefreshListener() {

            @Override
            public void onRefresh() {
                firstIndex = 1;
                requestData();
            }
        });

        lv_specified.setOnLoadMoreListener(new OnLoadMoreListener() {

            @Override
            public void onLoadMore() {
                firstIndex += pageSize;
                requestData();
            }
        });
        empty_view.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                lv_specified.refresh();
            }
        });

        lv_specified.refresh();
    }


    @Override
    protected void onResume() {
        super.onResume();
        lv_specified.refresh();
        requestData();
    }

    @Override
    public void requestData() {
        Bundle bundle = getIntent().getExtras();
        int minPer = bundle.getInt("minPer");
        int readInterval = bundle.getInt("readInterval");
        int signMark = bundle.getInt("signMark");
        int Mark = bundle.getInt("Mark");
        int photoMark = bundle.getInt("photoMark");
        int feeType = bundle.getInt("feeType");
        orgId = bundle.getString("orgId");
        String forbidHour = bundle.getString("forbidHour");
        int faceRecgMark = bundle.getInt("faceRecgMark");
        String photoUrl = bundle.getString("personphotoUrl");
        orgName = bundle.getString("orgName");
        int mtSeqMark = bundle.getInt("mtSeqMark");
        int allowMuT = bundle.getInt("allowMuT");


        tv_company.setText(orgName);
        tv_name.setText(UserManger.getUserInfo().getData().getUserName());
        SharedPreferences sp1 = getSharedPreferences("SpecifiedLearningHomeActivity",
                Context.MODE_PRIVATE);
        SharedPreferences.Editor edit1 = sp1.edit();
        edit1.putInt("photoMark", photoMark);
        edit1.putInt("signMark", signMark);
        edit1.putInt("minPer", minPer);
        edit1.putInt("readInterval", readInterval);
        edit1.putInt("Mark", Mark);
        edit1.putInt("faceRecgMark", faceRecgMark);
        edit1.putInt("feeType", feeType);
        edit1.putString("orgId", orgId);
        edit1.putString("forbidHour", forbidHour);
        edit1.putString("photoUrl", photoUrl);
        edit1.putInt("mtSeqMark", mtSeqMark);
        edit1.putInt("allowMuT", allowMuT);
        edit1.commit();
        LoginUserBean userInfo = UserManger.getUserInfo();
        LoginUserBean.DataBean data = userInfo.getData();
        if (data == null) {
            return;
        }
        userId = data.getUserId();
        new Login().getSpecifiedLearningTwo(orgId, userId, 1, 0, firstIndex, pageSize, this, 1);
        new Login().getUserDailytraining(orgId, userId, this, 2);
        new Login().getSpecifiedLearningTwo(orgId, userId, 1, 0, 1, 10000, this, 3);//获取所有条数

        new Login().trainingIndvPriceFind(orgId, SpecifiedLearningHomeActivity.this, 6); //获取会员方案列表
    }

    @Override
    public void onSuccess(String result, Call call, Response response, int what) {
        super.onSuccess(result, call, response, what);
        if (what == 1) {
            SpecifiedLearnIngHomeBean specifiedLearnIngHomeBean = JSON.parseObject(result, SpecifiedLearnIngHomeBean.class);
            if (specifiedLearnIngHomeBean != null) {
                try {

                    if (specifiedLearnIngHomeBean.getRows() != null && specifiedLearnIngHomeBean.getRows().size() > 0) {
                        lv_specified.setVisibility(View.VISIBLE);
                        if (firstIndex == 1) {
                            specifiedLearningHomeApt.clear();
                            specifiedLearningHomeApt.setDataList(specifiedLearnIngHomeBean.getRows());
                        } else {
                            specifiedLearningHomeApt.addAll(specifiedLearnIngHomeBean.getRows());
                        }

                        if (specifiedLearnIngHomeBean.getRows().size() < pageSize) {
                            lv_specified.setNoMore(true);
                        }
                    } else {
                        if (firstIndex == 1) {//第一页
                            lv_specified.setEmptyView(empty_view);
                            specifiedLearningHomeApt.clear();
                        } else {
                            lv_specified.setNoMore(true);
                        }
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                }
                lv_specified.refreshComplete(specifiedLearnIngHomeBean.getRows() == null ? 0 : specifiedLearnIngHomeBean.getRows().size());
                lRecyclerViewAdapter1.notifyDataSetChanged();
            }
        } else if (what == 2) {
            DailyPriceBean mineUseBean = JSON.parseObject(result, DailyPriceBean.class);
            DailyPriceBean.DataBean dailydata = mineUseBean.getData();
            float balance = dailydata.getBalance();
            float satPrice = dailydata.getMtPrice();
            SharedPreferences sp1 = getSharedPreferences("SpecifiedLearningHomeActivity",
                    Context.MODE_PRIVATE);
            SharedPreferences.Editor edit = sp1.edit();
            edit.putFloat("satPrice", satPrice);
            edit.putFloat("balance", balance);
            edit.commit();
        } else if (what == 3) {
            SpecifiedLearnIngHomeBean specifiedLearnIngHomeBean = JSON.parseObject(result, SpecifiedLearnIngHomeBean.class);
            rowList = specifiedLearnIngHomeBean.getRows();
        } else  if (what == 6) {
            TrainingIndvPriceFindBean bean = JSON.parseObject(result, TrainingIndvPriceFindBean.class);
            List<TrainingIndvPriceFindBean.RowsBean> rowsBeans = bean.getRows();
            if (rowsBeans == null || rowsBeans.size() <= 0) {
                buyMember = false;
            } else {
                buyMember = true;
            }
        }
    }


    public class SpecifiedLearningHomeApt extends ListBaseAdapter<SpecifiedLearnIngHomeBean.RowsBean> {
        protected Context context = null;

        public SpecifiedLearningHomeApt(Context context) {
            super(context);
            this.context = context;
        }

        @Override
        public int getLayoutId() {
            return R.layout.specifiedlearning_item_layout;
        }

        @Override
        public void onBindItemHolder(SuperViewHolder holder, final int position) {

            SpecifiedLearnIngHomeBean.RowsBean rowsBean = getDataList().get(position);

            TextView tv_chNo = holder.getView(R.id.tv_chNo);
            TextView tv_title = holder.getView(R.id.tv_title);
            TextView tv_yes = holder.getView(R.id.tv_parent4);//完成情况
            TextView tv_sign = holder.getView(R.id.tv_parent8);//签名情况
            TextView tv_check = holder.getView(R.id.tv_parent5);//审核情况
            TextView tv_Spotcheck = holder.getView(R.id.tv_parent7);//抽查情况
            TextView tv_actualChLength = holder.getView(R.id.tv_time);//实际学习时间
            // TextView tv_setChLength =  holder.getView(R.id.tv_time1);//计划学习时间
            TextView tv_line_specified = holder.getView(R.id.tv_line_specified);//背景条
            final TextView tv_specified_learning = holder.getView(R.id.tv_specified_learning);//学习/签名
            ImageView img_share = holder.getView(R.id.img_share);
            RelativeLayout re_specified1 = holder.getView(R.id.re_specified1);
            final String chName = rowsBean.getChName();


            ImageView itemSpecifiedLearning = holder.getView(R.id.ac_specifiedLearning_iv_startExam);
            TextView itemSpLearnTvNeedExam = holder.getView(R.id.ac_specifiedLearning_tv_needExam);
            RelativeLayout rlSpecifiedLearning = holder.getView(R.id.rl_specified_learning);

            itemSpecifiedLearning.setVisibility(View.GONE);
            itemSpLearnTvNeedExam.setVisibility(View.INVISIBLE);


            /*re_specified1.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    int sn = rowsBean.getSn();
                    String chName=rowsBean.getChName();
                    long endDate=rowsBean.getEndDate();
                    String signPicUrl=HelpUtil.judgeStrNull(rowsBean.getSignPicUrl());
                    Bundle bundle=new Bundle();
                    bundle.putInt("sn", sn);
                    bundle.putString("chName",chName);
                    bundle.putLong("endDate",endDate);
                    bundle.putString("signPicUrl",signPicUrl);
                    bundle.putString("orgName",orgName);
                    bundle.putString("orgId",orgId);
                    startActivity(StubActivity.class,bundle);
                }
            });*/

            re_specified1.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    if (Utils.isFastClicker()) {
                        return;
                    }



                    SharedPreferences sp1 = getSharedPreferences("SpecifiedLearningHomeActivity", Context.MODE_PRIVATE);
                    int feeType = sp1.getInt("feeType", 0);
                    final float balance = sp1.getFloat("balance", 0);
                    float satPrice = sp1.getFloat("satPrice", 0);
                    int mtSeqMark = sp1.getInt("mtSeqMark", 0);
                    int allowMuT = sp1.getInt("allowMuT", 0);



                    int chNo = rowsBean.getChNo();
                    int payMark = (rowsBean.getPayMark() == null) ? 0 : (int) rowsBean.getPayMark();
                    int utchSn = rowsBean.getSn();
                    if (feeType == 2) { //个人付费
                        int finishMark = rowsBean.getFinishMark();
                        String learningstr = tv_specified_learning.getText().toString();
                        //if (finishMark == 0 && learningstr.equals("学习")) { //未完成

                        if (finishMark == 0) {
                            JSONObject js_request = new JSONObject();//服务器需要传参的json对象
                            try {
                                js_request.put("userId", userId);//根据实际需求添加相应键值对
                                js_request.put("orgId", orgId);
                                js_request.put("setYm",rowsBean.getStatYm());
                            } catch (JSONException e) {
                                e.printStackTrace();
                            }
                            LogUtils.e("测试", "onClick: "+js_request.toString() );
                            RequestParams params = new RequestParams(AppInterfaceConfig.BASE_URL + "sys/userVip/check");
                            params.setAsJsonContent(true);
                            params.setBodyContent(js_request.toString());
                            x.http().post(params, new Callback.CommonCallback<String>() {
                                @Override
                                public void onSuccess(String result) {
                                    UserVipCheckBean bean = JSON.parseObject(result, UserVipCheckBean.class);
                                    boolean checkResult = bean.isResult();
                                    if (checkResult) { //在会员期内
                                        new Login().useTcHourUpdatePayMark(utchSn + "", "2", SpecifiedLearningHomeActivity.this, 5);
                                    } else {
                                        if (payMark == 0) { //未支付
                                            if (buyMember) { //需要买会员
                                                TiShiDialog.Builder builder1 = new TiShiDialog.Builder(SpecifiedLearningHomeActivity.this);
                                                builder1.setMessage("您所属企业可购买包月会员");
                                                builder1.setTitle("提示:");
                                                builder1.setPositiveButton("买会员", new DialogInterface.OnClickListener() {
                                                    public void onClick(DialogInterface dialog, int which) {
                                                        dialog.dismiss();
                                                        //startActivity(MemberInfoActivity.class, null);
                                                        //startActivity(MemberMsgActivity.class, null);
                                                    }
                                                });
                                                builder1.setNegativeButton("取消",
                                                        new android.content.DialogInterface.OnClickListener() {
                                                            public void onClick(DialogInterface dialog, int which) {
                                                                dialog.dismiss();
                                                            }
                                                        });

                                                builder1.create().show();
                                                return;
                                            } else {
                                                TiShiDialog.Builder builder1 = new TiShiDialog.Builder(SpecifiedLearningHomeActivity.this);
                                                builder1.setMessage("您所属企业需要您自己付费学习，您当前余额" + balance + "元，学习花费" + chNo * satPrice + "元");
                                                builder1.setTitle("提示:");
                                                builder1.setPositiveButton("去付费", new DialogInterface.OnClickListener() {
                                                    public void onClick(DialogInterface dialog, int which) {
                                                        dialog.dismiss();
                                                        //设置你的操作事项
                                                        SharedPreferences sp = getSharedPreferences("SpecifiedLearningHomeActivity", Context.MODE_PRIVATE);
                                                        String orgId = sp.getString("orgId", "");//总支付金额
                                                        double diffentprice = Double.valueOf(chNo * satPrice) - Double.valueOf(balance); //还需支付费用
                                                        Bundle bundle = new Bundle();
                                                        bundle.putString("orgId", orgId);
                                                        bundle.putInt("utchSn", utchSn);
                                                        bundle.putDouble("amount", chNo * satPrice);
                                                        bundle.putDouble("balance", balance);
                                                        bundle.putString("chName", chName);
                                                        startActivity(SpecifiedLearningPayActivity.class, bundle);
                                                    }
                                                });
                                                builder1.setNegativeButton("取消",
                                                        new android.content.DialogInterface.OnClickListener() {
                                                            public void onClick(DialogInterface dialog, int which) {
                                                                dialog.dismiss();
                                                            }
                                                        });

                                                builder1.create().show();
                                                return;
                                            }

                                        }
                                    }

                                    int Mark = sp1.getInt("Mark", 0);
                                    int photoMark = sp1.getInt("photoMark", 0);
                                    int signMark = sp1.getInt("signMark", 0);
                                    int minPer = sp1.getInt("minPer", 0);
                                    int readInterval = sp1.getInt("readInterval", 0);
                                    int faceRecgMark = sp1.getInt("faceRecgMark", 0);
                                    String orgId = sp1.getString("orgId", "");
                                    String forbidHour = sp1.getString("forbidHour", "");
                                    String photoUrl = sp1.getString("photoUrl", "");
                                    int sn = rowsBean.getSn();
                                    String statYm = rowsBean.getStatYm();
                                    int actualChLength = rowsBean.getActualChLength();
                                    int setChLength = 0;
                                    setChLength = (rowsBean.getMiNo() > rowsBean.getSetChLength()) ? rowsBean.getMiNo() : rowsBean.getSetChLength();
                                    int checkMark = rowsBean.getCheckMark();
                                    Integer qpSn = rowsBean.getQpSn();

                                    if (mtSeqMark == 1) {
                                        DateFormat df = new SimpleDateFormat("yyyy-MM");
                                        //  List<SpecifiedLearnIngHomeBean.RowsBean> rowList = getDataList();
                                        specifielist.clear();
                                        for (int i = 0; i < rowList.size(); i++) {
                                            try {
                                                if (df.parse(rowList.get(i).getStatYm()).getTime() < df.parse(statYm).getTime()) {
                                                    specifielist.add(rowList.get(i));
                                                }
                                            } catch (ParseException e) {
                                                e.printStackTrace();
                                            }
                                        }
                                        specifielist1.clear();
                                        for (int i = 0; i < specifielist.size(); i++) {
                                            if (specifielist.get(i).getFinishMark() == 0) {
                                                specifielist1.add(specifielist.get(i));
                                            }
                                        }
                                        if (specifielist1.size() > 0) {
                                            TiShiDialog.Builder builder1 = new TiShiDialog.Builder(SpecifiedLearningHomeActivity.this);
                                            builder1.setMessage("请先学习上月或以往未完成月份的日常培训");
                                            builder1.setTitle("提示:");
                                            builder1.setPositiveButton("我知道", new DialogInterface.OnClickListener() {
                                                public void onClick(DialogInterface dialog, int which) {
                                                    dialog.dismiss();
                                                    ;
                                                    //设置你的操作事项
                                                }
                                            });
                                            builder1.create().show();

                                            return;
                                        }

                                        // int finishMark = rowsBean.getFinishMark();
                                        Bundle bundle = new Bundle();
                                        bundle.putInt("Mark", Mark);
                                        bundle.putInt("photoMark", photoMark);
                                        bundle.putInt("signMark", signMark);
                                        bundle.putInt("minPer", minPer);
                                        bundle.putInt("readInterval", readInterval);
                                        bundle.putString("orgId", orgId);
                                        bundle.putInt("sn", sn);
                                        bundle.putString("statYm", statYm);
                                        bundle.putString("forbidHour", forbidHour);
                                        bundle.putString("chName", chName);
                                        bundle.putInt("actualChLength", actualChLength);
                                        bundle.putInt("setChLength", setChLength);
                                        bundle.putInt("checkMark", checkMark);
                                        bundle.putInt("finishMark", finishMark);
                                        bundle.putInt("faceRecgMark", faceRecgMark);
                                        bundle.putString("photoUrl", photoUrl);
                                        bundle.putInt("chNo", chNo);
                                        bundle.putInt("allowMuT", allowMuT);
                                        bundle.putInt("rtype", otpSn);
                                        bundle.putInt("qnSn",qnSn);
                                        bundle.putInt("learnsn", sn);
                                        if (qpSn == null) {
                                            bundle.putInt("qpSn", 0);
                                        } else {
                                            bundle.putInt("qpSn", qpSn);
                                        }
                                        if(tv_specified_learning.getText().toString().trim().equals("开始考试")){
                                            startActivity(DailyTrainingExaminationItemActivity.class, bundle);
                                        }else{
                                            startActivity(SubSpecifiedLearningHome1Activity.class, bundle);
                                        }
                                    } else if (mtSeqMark == 0) {
                                        Bundle bundle = new Bundle();
                                        bundle.putInt("Mark", Mark);
                                        bundle.putInt("photoMark", photoMark);
                                        bundle.putInt("signMark", signMark);
                                        bundle.putInt("minPer", minPer);
                                        bundle.putInt("readInterval", readInterval);
                                        bundle.putString("orgId", orgId);
                                        bundle.putInt("sn", sn);
                                        bundle.putString("statYm", statYm);
                                        bundle.putString("forbidHour", forbidHour);
                                        bundle.putString("chName", chName);
                                        bundle.putInt("actualChLength", actualChLength);
                                        bundle.putInt("setChLength", setChLength);
                                        bundle.putInt("checkMark", checkMark);
                                        bundle.putInt("finishMark", finishMark);
                                        bundle.putInt("faceRecgMark", faceRecgMark);
                                        bundle.putString("photoUrl", photoUrl);
                                        bundle.putInt("chNo", chNo);
                                        bundle.putInt("allowMuT", allowMuT);
                                        bundle.putInt("rtype", otpSn);
                                        bundle.putInt("qnSn",qnSn);
                                        bundle.putInt("learnsn", sn);
                                        if (qpSn == null) {
                                            bundle.putInt("qpSn", 0);
                                        } else {
                                            bundle.putInt("qpSn", qpSn);
                                        }

                                        if(tv_specified_learning.getText().toString().trim().equals("开始考试")){
                                            startActivity(DailyTrainingExaminationItemActivity.class, bundle);
                                        }else{
                                            startActivity(SubSpecifiedLearningHome1Activity.class, bundle);
                                        }
                                    }
                                }

                                @Override
                                public void onError(Throwable ex, boolean isOnCallback) {

                                }

                                @Override
                                public void onCancelled(CancelledException cex) {

                                }

                                @Override
                                public void onFinished() {

                                }
                            });
                        } else {//已完成
                            int Mark = sp1.getInt("Mark", 0);
                            int photoMark = sp1.getInt("photoMark", 0);
                            int signMark = sp1.getInt("signMark", 0);
                            int minPer = sp1.getInt("minPer", 0);
                            int readInterval = sp1.getInt("readInterval", 0);
                            int faceRecgMark = sp1.getInt("faceRecgMark", 0);
                            String orgId = sp1.getString("orgId", "");
                            String forbidHour = sp1.getString("forbidHour", "");
                            String photoUrl = sp1.getString("photoUrl", "");
                            int sn = rowsBean.getSn();
                            String statYm = rowsBean.getStatYm();
                            int actualChLength = rowsBean.getActualChLength();
                            int setChLength = 0;
                            setChLength = (rowsBean.getMiNo() > rowsBean.getSetChLength()) ? rowsBean.getMiNo() : rowsBean.getSetChLength();
                            int checkMark = rowsBean.getCheckMark();
                            Integer qpSn = rowsBean.getQpSn();
                            Bundle bundle = new Bundle();
                            bundle.putInt("Mark", Mark);
                            bundle.putInt("photoMark", photoMark);
                            bundle.putInt("signMark", signMark);
                            bundle.putInt("minPer", minPer);
                            bundle.putInt("readInterval", readInterval);
                            bundle.putString("orgId", orgId);
                            bundle.putInt("sn", sn);
                            bundle.putString("statYm", statYm);
                            bundle.putString("forbidHour", forbidHour);
                            bundle.putString("chName", chName);
                            bundle.putInt("actualChLength", actualChLength);
                            bundle.putInt("setChLength", setChLength);
                            bundle.putInt("checkMark", checkMark);
                            bundle.putInt("finishMark", finishMark);
                            bundle.putInt("faceRecgMark", faceRecgMark);
                            bundle.putString("photoUrl", photoUrl);
                            bundle.putInt("chNo", chNo);
                            bundle.putInt("allowMuT", allowMuT);
                            bundle.putInt("rtype", otpSn);
                            bundle.putInt("qnSn",qnSn);
                            if (qpSn == null) {
                                bundle.putInt("qpSn", 0);
                            } else {
                                bundle.putInt("qpSn", qpSn);
                            }
                            startActivity(SubSpecifiedLearningHome1Activity.class, bundle);
                        }
                    } else if (feeType == 1) {
                        int Mark = sp1.getInt("Mark", 0);
                        int photoMark = sp1.getInt("photoMark", 0);
                        int signMark = sp1.getInt("signMark", 0);
                        int minPer = sp1.getInt("minPer", 0);
                        int readInterval = sp1.getInt("readInterval", 0);
                        int faceRecgMark = sp1.getInt("faceRecgMark", 0);
                        String orgId = sp1.getString("orgId", "");
                        String forbidHour = sp1.getString("forbidHour", "");
                        String photoUrl = sp1.getString("photoUrl", "");
                        int sn = rowsBean.getSn();
                        String statYm = rowsBean.getStatYm();
                        int actualChLength = rowsBean.getActualChLength();
                        int setChLength = 0;
                        setChLength = (rowsBean.getMiNo() > rowsBean.getSetChLength()) ? rowsBean.getMiNo() : rowsBean.getSetChLength();
                        int checkMark = rowsBean.getCheckMark();
                        int finishMark = rowsBean.getFinishMark();
                        Integer qpSn = rowsBean.getQpSn();
                        if (finishMark == 0) {
                            if (mtSeqMark == 1) {
                                DateFormat df = new SimpleDateFormat("yyyy-MM");
                                //  List<SpecifiedLearnIngHomeBean.RowsBean> rowList = getDataList();
                                specifielist.clear();
                                for (int i = 0; i < rowList.size(); i++) {
                                    LogUtils.e("测试", "onClick: " + rowList.get(i).getStatYm() + "  " + statYm);
                                    try {
                                        if (df.parse(rowList.get(i).getStatYm()).getTime() < df.parse(statYm).getTime()) {
                                            specifielist.add(rowList.get(i));
                                        }
                                    } catch (ParseException e) {
                                        e.printStackTrace();
                                    }
                                }
                                specifielist1.clear();
                                for (int i = 0; i < specifielist.size(); i++) {
                                    if (specifielist.get(i).getFinishMark() == 0) {
                                        specifielist1.add(specifielist.get(i));
                                    }
                                }
                                if (specifielist1.size() > 0) {
                                    TiShiDialog.Builder builder1 = new TiShiDialog.Builder(SpecifiedLearningHomeActivity.this);
                                    builder1.setMessage("请先学习上月或以往未完成月份的日常培训");
                                    builder1.setTitle("提示:");
                                    builder1.setPositiveButton("我知道", new DialogInterface.OnClickListener() {
                                        public void onClick(DialogInterface dialog, int which) {
                                            dialog.dismiss();
                                            ;
                                            //设置你的操作事项
                                        }
                                    });
                                    builder1.create().show();

                                    return;
                                }
                                Bundle bundle = new Bundle();
                                bundle.putInt("Mark", Mark);
                                bundle.putInt("photoMark", photoMark);
                                bundle.putInt("signMark", signMark);
                                bundle.putInt("minPer", minPer);
                                bundle.putInt("readInterval", readInterval);
                                bundle.putString("orgId", orgId);
                                bundle.putInt("sn", sn);
                                bundle.putString("statYm", statYm);
                                bundle.putString("forbidHour", forbidHour);
                                bundle.putString("chName", chName);
                                bundle.putInt("actualChLength", actualChLength);
                                bundle.putInt("setChLength", setChLength);
                                bundle.putInt("checkMark", checkMark);
                                bundle.putInt("finishMark", finishMark);
                                bundle.putInt("faceRecgMark", faceRecgMark);
                                bundle.putString("photoUrl", photoUrl);
                                bundle.putInt("chNo", chNo);
                                bundle.putInt("allowMuT", allowMuT);
                                bundle.putInt("rtype", otpSn);
                                bundle.putInt("qnSn",qnSn);
                                bundle.putInt("learnsn", sn);
                                if (qpSn == null) {
                                    bundle.putInt("qpSn", 0);
                                } else {

                                    bundle.putInt("qpSn", qpSn);
                                }
                                if(tv_specified_learning.getText().toString().trim().equals("开始考试")){
                                    startActivity(DailyTrainingExaminationItemActivity.class, bundle);
                                }else{
                                    startActivity(SubSpecifiedLearningHome1Activity.class, bundle);
                                }
                            } else if (mtSeqMark == 0) {
                                Bundle bundle = new Bundle();
                                bundle.putInt("Mark", Mark);
                                bundle.putInt("photoMark", photoMark);
                                bundle.putInt("signMark", signMark);
                                bundle.putInt("minPer", minPer);
                                bundle.putInt("readInterval", readInterval);
                                bundle.putString("orgId", orgId);
                                bundle.putInt("sn", sn);
                                bundle.putString("statYm", statYm);
                                bundle.putString("forbidHour", forbidHour);
                                bundle.putString("chName", chName);
                                bundle.putInt("actualChLength", actualChLength);
                                bundle.putInt("setChLength", setChLength);
                                bundle.putInt("checkMark", checkMark);
                                bundle.putInt("finishMark", finishMark);
                                bundle.putInt("faceRecgMark", faceRecgMark);
                                bundle.putString("photoUrl", photoUrl);
                                bundle.putInt("chNo", chNo);
                                bundle.putInt("allowMuT", allowMuT);
                                bundle.putInt("rtype", otpSn);
                                bundle.putInt("qnSn",qnSn);
                                bundle.putInt("learnsn", sn);
                                if (qpSn == null) {
                                    bundle.putInt("qpSn", 0);
                                } else {
                                    bundle.putInt("qpSn", qpSn);
                                }
                                if(tv_specified_learning.getText().toString().trim().equals("开始考试")){
                                    startActivity(DailyTrainingExaminationItemActivity.class, bundle);
                                }else{
                                    startActivity(SubSpecifiedLearningHome1Activity.class, bundle);
                                }
                            }
                        } else {//已完成
                            Bundle bundle = new Bundle();
                            bundle.putInt("Mark", Mark);
                            bundle.putInt("photoMark", photoMark);
                            bundle.putInt("signMark", signMark);
                            bundle.putInt("minPer", minPer);
                            bundle.putInt("readInterval", readInterval);
                            bundle.putString("orgId", orgId);
                            bundle.putInt("sn", sn);
                            bundle.putString("statYm", statYm);
                            bundle.putString("forbidHour", forbidHour);
                            bundle.putString("chName", chName);
                            bundle.putInt("actualChLength", actualChLength);
                            bundle.putInt("setChLength", setChLength);
                            bundle.putInt("checkMark", checkMark);
                            bundle.putInt("finishMark", finishMark);
                            bundle.putInt("faceRecgMark", faceRecgMark);
                            bundle.putString("photoUrl", photoUrl);
                            bundle.putInt("chNo", chNo);
                            bundle.putInt("allowMuT", allowMuT);
                            bundle.putInt("rtype", otpSn);
                            bundle.putInt("qnSn",qnSn);
                            if (qpSn == null) {
                                bundle.putInt("qpSn", 0);
                            } else {
                                bundle.putInt("qpSn", qpSn);
                            }

                            startActivity(SubSpecifiedLearningHome1Activity.class, bundle);
                        }
                    }
                }
            });

            int chNo = rowsBean.getChNo();
            if (chNo == 0) {
                tv_chNo.setText("学时");
            } else {
                tv_chNo.setText(chNo + "学时");
            }
            if (chName == null) {
                tv_title.setText("");
            } else {
                tv_title.setText(chName);
            }

            int finishMark = rowsBean.getFinishMark();
            final Integer qpSn = rowsBean.getQpSn();

            if (finishMark == 0) {//未完成
                int actualChLength = rowsBean.getActualChLength();
                int setChLength = 0;
                setChLength = (rowsBean.getMiNo() > rowsBean.getSetChLength()) ? rowsBean.getMiNo() : rowsBean.getSetChLength();
                if (actualChLength == 0 || setChLength == 0) {
                    tv_actualChLength.setText("0%");
                    tv_actualChLength.setTextColor(SpecifiedLearningHomeActivity.this.getResources().getColor(R.color.bixue_red));
                    tv_specified_learning.setText("学习");
                    tv_line_specified.setBackgroundResource(R.color.specified_red);
                    img_share.setVisibility(View.INVISIBLE);
                    tv_yes.setText("未完成");
                    tv_yes.setBackgroundResource(R.drawable.shape_specified_nored);
                    tv_check.setVisibility(View.GONE);
                    tv_sign.setVisibility(View.GONE);
                } else {
                    float studyper = (float) actualChLength / (float) setChLength;
                    if (studyper < 1) {
                        int studyper1 = (int) (studyper * 100);
                        //  String ss = String.format("%1.2f", studyper1);
                        tv_actualChLength.setText(studyper1 + "%");
                        tv_actualChLength.setTextColor(SpecifiedLearningHomeActivity.this.getResources().getColor(R.color.bixue_red));
                        tv_specified_learning.setText("学习");
                        tv_line_specified.setBackgroundResource(R.color.specified_red);
                        img_share.setVisibility(View.INVISIBLE);
                        tv_yes.setText("未完成");
                        tv_yes.setBackgroundResource(R.drawable.shape_specified_nored);
                        tv_check.setVisibility(View.GONE);
                        tv_sign.setVisibility(View.GONE);

                    } else {//未完成 实际时间大于计划时间 判断是qpSn否有值
                        if (qpSn == null) {
                            tv_specified_learning.setText("学习");
                            tv_line_specified.setBackgroundResource(R.color.specified_red);
                            img_share.setVisibility(View.INVISIBLE);
                            tv_yes.setText("未完成");
                            tv_yes.setBackgroundResource(R.drawable.shape_specified_nored);
                            tv_check.setVisibility(View.GONE);
                            tv_sign.setVisibility(View.GONE);
                            tv_actualChLength.setText(99 + "%");
                            tv_actualChLength.setTextColor(SpecifiedLearningHomeActivity.this.getResources().getColor(R.color.bixue_red));
                        } else {
                            tv_specified_learning.setText("开始考试");
                            itemSpecifiedLearning.setVisibility(View.VISIBLE);
                            itemSpLearnTvNeedExam.setVisibility(View.VISIBLE);
                            Glide.with(context).load(R.drawable.exam_start1).into(itemSpecifiedLearning);
                            img_share.setVisibility(View.INVISIBLE);
                            tv_yes.setText("已完成");
                            tv_yes.setBackgroundResource(R.drawable.shape_specified_dai);
                            tv_check.setVisibility(View.GONE);
                            tv_sign.setVisibility(View.GONE);
                            tv_actualChLength.setText(100 + "%");

                            tv_line_specified.setBackgroundResource(R.color.holetotal_yellow);
                            tv_actualChLength.setTextColor(SpecifiedLearningHomeActivity.this.getResources().getColor(R.color.holetotal_yellow));
                            /*tv_line_specified.setBackgroundResource(R.color.bixue_red);
                            tv_actualChLength.setTextColor(SpecifiedLearningHomeActivity.this.getResources().getColor(R.color.bixue_red));*/
                        }
                    }
                }
            } else {//已完成
                SharedPreferences sp = getSharedPreferences("SpecifiedLearningHomeActivity",
                        Context.MODE_PRIVATE);
                int signMark = sp.getInt("signMark", 0);
                final String signPicUrl = HelpUtil.judgeStrNull(rowsBean.getSignPicUrl());
                int checkMark = rowsBean.getCheckMark();
                if (signMark >= 1) {
                    if (qpSn == null) {
                        if (checkMark == 1 || checkMark == 2) {
                            if (signPicUrl.equals("")) {
                                tv_specified_learning.setText("签名");
                            } else {
                                tv_specified_learning.setText("查看签名");
                            }
                        } else if (checkMark == 0) {
                            if (finishMark == 1) {
                                tv_specified_learning.setText("签名");
                            } else if (finishMark == 2) {
                                tv_specified_learning.setText("查看签名");
                            }

                        }
                    } else {
                        tv_specified_learning.setText("开始考试");
                        itemSpecifiedLearning.setVisibility(View.VISIBLE);
                        itemSpLearnTvNeedExam.setVisibility(View.VISIBLE);
                        Glide.with(context).load(R.drawable.exam_start1).into(itemSpecifiedLearning);
                    }

                } else if (signMark == 0) {
                    if (qpSn == null) {
                        tv_specified_learning.setText("查看签名");
                        /*if (checkMark == 1 || checkMark == 2) {
                         *//*if (signPicUrl == null) {
                                tv_specified_learning.setVisibility(View.GONE);
                            } else {
                                tv_specified_learning.setVisibility(View.VISIBLE);
                                tv_specified_learning.setText("查看签名");
                            }*//*
                            tv_specified_learning.setText("查看签名");
                        } else if (checkMark == 0) {
                            if (finishMark == 1) {
                                tv_specified_learning.setVisibility(View.GONE);
                            } else if (finishMark == 2) {
                                tv_specified_learning.setVisibility(View.VISIBLE);
                                tv_specified_learning.setText("查看签名");
                            }
                        }*/
                    } else {
                        tv_specified_learning.setText("开始考试");
                        itemSpecifiedLearning.setVisibility(View.VISIBLE);
                        itemSpLearnTvNeedExam.setVisibility(View.VISIBLE);
                        Glide.with(context).load(R.drawable.exam_start1).into(itemSpecifiedLearning);
                    }
                }

                tv_actualChLength.setText(100 + "%");
                tv_actualChLength.setTextColor(SpecifiedLearningHomeActivity.this.getResources().getColor(R.color.holetotal_gray));
            }

            if (rowsBean.getSpotCheckMark() == 1) {
                tv_Spotcheck.setVisibility(View.VISIBLE);
                tv_Spotcheck.setText("通过抽查");
                tv_Spotcheck.setBackgroundResource(R.drawable.shape_specified_yes);
            } else if (rowsBean.getSpotCheckMark() == 2) {
                tv_Spotcheck.setVisibility(View.VISIBLE);
                tv_Spotcheck.setText("未通过抽查");
                tv_Spotcheck.setBackgroundResource(R.drawable.shape_specified_nored);
            } else {
                tv_Spotcheck.setVisibility(View.INVISIBLE);
            }


            SharedPreferences sp = getSharedPreferences("SpecifiedLearningHomeActivity",
                    Context.MODE_PRIVATE);
            int signMark = sp.getInt("signMark", 0);
            if (signMark >= 1)//是否签名
            {
                if (rowsBean.getCheckMark() == 2) {
                    tv_line_specified.setBackgroundResource(R.color.specified_red);
                    tv_check.setVisibility(View.VISIBLE);
                    tv_check.setText("审核未通过");
                    tv_check.setBackgroundResource(R.drawable.shape_specified_nored);
                    tv_yes.setText("已完成");
                    img_share.setVisibility(View.VISIBLE);
                    tv_yes.setBackgroundResource(R.drawable.shape_specified_yes);
                    tv_sign.setVisibility(View.VISIBLE);
                    final String signPicUrl = HelpUtil.judgeStrNull(rowsBean.getSignPicUrl());

                    if (signPicUrl.equals("")) {
                        tv_sign.setText("未签名");
                        tv_sign.setBackgroundResource(R.drawable.shape_specified_noorange);
                        //   tv_specified_learning.setText("签名");
                        rlSpecifiedLearning.setOnClickListener(new View.OnClickListener() {
                            @Override
                            public void onClick(View view) {
                                if (Utils.isFastClicker()) {
                                    return;
                                }

                                if (tv_specified_learning.getText().toString().trim().equals("签名")) {
                                    int sn = rowsBean.getSn();
                                    Bundle bundle = new Bundle();
                                    bundle.putInt("sn", sn);
                                    bundle.putString("signPicUrl", "");
                                    bundle.putInt("signMark", signMark);
                                    startActivity(SignActivity.class, bundle);
                                } else if (tv_specified_learning.getText().toString().trim().equals("开始考试")) {
                                    int sn = rowsBean.getSn();
                                    SharedPreferences sp = getSharedPreferences("SpecifiedLearningHomeActivity",
                                            Context.MODE_PRIVATE);
                                    String orgId = sp.getString("orgId", "");
                                    int faceRecgMark = sp.getInt("faceRecgMark", 0);
                                    String photoUrl = sp.getString("photoUrl", "");
                                    Bundle bundle = new Bundle();
                                    bundle.putString("orgId", orgId);
                                    bundle.putInt("qpSn", qpSn);
                                    bundle.putInt("learnsn", sn);
                                    bundle.putInt("faceRecgMark", faceRecgMark);
                                    bundle.putString("photoUrl", photoUrl);
                                    startActivity(DailyTrainingExaminationItemActivity.class, bundle);
                                }
                            }
                        });

                    } else {
                        tv_sign.setText("已签名");
                        tv_sign.setBackgroundResource(R.drawable.shape_specified_yes);
                        //    tv_specified_learning.setText("查看签名");

                        rlSpecifiedLearning.setOnClickListener(new View.OnClickListener() {
                            @Override
                            public void onClick(View view) {
                                if (Utils.isFastClicker()) {
                                    return;
                                }
                                if (tv_specified_learning.getText().toString().trim().equals("查看签名")) {
                                    int sn = rowsBean.getSn();
                                    Bundle bundle = new Bundle();
                                    bundle.putInt("sn", sn);
                                    bundle.putString("signPicUrl", signPicUrl);
                                    bundle.putInt("signMark", signMark);
                                    startActivity(SignActivity.class, bundle);
                                } else if (tv_specified_learning.getText().toString().trim().equals("开始考试")) {
                                    int sn = rowsBean.getSn();
                                    SharedPreferences sp = getSharedPreferences("SpecifiedLearningHomeActivity",
                                            Context.MODE_PRIVATE);
                                    String orgId = sp.getString("orgId", "");
                                    int faceRecgMark = sp.getInt("faceRecgMark", 0);
                                    String photoUrl = sp.getString("photoUrl", "");
                                    Bundle bundle = new Bundle();
                                    bundle.putString("orgId", orgId);
                                    bundle.putInt("qpSn", qpSn);
                                    bundle.putInt("learnsn", sn);
                                    bundle.putInt("faceRecgMark", faceRecgMark);
                                    bundle.putString("photoUrl", photoUrl);
                                    startActivity(DailyTrainingExaminationItemActivity.class, bundle);
                                }
                            }
                        });

                    }
                } else if (rowsBean.getCheckMark() == 1) {
                    tv_line_specified.setBackgroundResource(R.color.holetotal_gray);
                    img_share.setVisibility(View.VISIBLE);
                    tv_check.setVisibility(View.GONE);
//                        tv_check.setText("审核通过");
//                        tv_check.setBackgroundResource(R.drawable.shape_specified_yes);
                    tv_yes.setText("已完成");
                    tv_yes.setBackgroundResource(R.drawable.shape_specified_yes);
                    tv_sign.setVisibility(View.VISIBLE);
                    final String signPicUrl = HelpUtil.judgeStrNull(rowsBean.getSignPicUrl());
                    if (signPicUrl.equals("")) {
                        tv_sign.setText("未签名");
                        tv_sign.setBackgroundResource(R.drawable.shape_specified_noorange);
                        //  tv_specified_learning.setText("签名");
                        rlSpecifiedLearning.setOnClickListener(new View.OnClickListener() {
                            @Override
                            public void onClick(View view) {
                                if (Utils.isFastClicker()) {
                                    return;
                                }
                                if (tv_specified_learning.getText().toString().trim().equals("签名")) {
                                    int sn = rowsBean.getSn();
                                    Bundle bundle = new Bundle();
                                    bundle.putInt("sn", sn);
                                    bundle.putString("signPicUrl", "");
                                    bundle.putInt("signMark", signMark);
                                    startActivity(SignActivity.class, bundle);
                                } else if (tv_specified_learning.getText().toString().trim().equals("开始考试")) {
                                    int sn = rowsBean.getSn();
                                    SharedPreferences sp = getSharedPreferences("SpecifiedLearningHomeActivity",
                                            Context.MODE_PRIVATE);
                                    String orgId = sp.getString("orgId", "");
                                    int faceRecgMark = sp.getInt("faceRecgMark", 0);
                                    String photoUrl = sp.getString("photoUrl", "");
                                    Bundle bundle = new Bundle();
                                    bundle.putString("orgId", orgId);
                                    bundle.putInt("qpSn", qpSn);
                                    bundle.putInt("learnsn", sn);
                                    bundle.putInt("faceRecgMark", faceRecgMark);
                                    bundle.putString("photoUrl", photoUrl);
                                    startActivity(DailyTrainingExaminationItemActivity.class, bundle);
                                }

                            }
                        });
                    } else {
                        tv_sign.setText("已签名");
                        tv_sign.setBackgroundResource(R.drawable.shape_specified_yes);
                        // tv_specified_learning.setText("查看签名");

                        rlSpecifiedLearning.setOnClickListener(new View.OnClickListener() {
                            @Override
                            public void onClick(View view) {
                                if (Utils.isFastClicker()) {
                                    return;
                                }
                                if (tv_specified_learning.getText().toString().trim().equals("查看签名")) {
                                    int sn = rowsBean.getSn();
                                    Bundle bundle = new Bundle();
                                    bundle.putInt("sn", sn);
                                    bundle.putString("signPicUrl", signPicUrl);
                                    bundle.putInt("signMark", signMark);
                                    startActivity(SignActivity.class, bundle);

                                } else if (tv_specified_learning.getText().toString().trim().equals("开始考试")) {
                                    int sn = rowsBean.getSn();
                                    SharedPreferences sp = getSharedPreferences("SpecifiedLearningHomeActivity",
                                            Context.MODE_PRIVATE);
                                    String orgId = sp.getString("orgId", "");
                                    int faceRecgMark = sp.getInt("faceRecgMark", 0);
                                    String photoUrl = sp.getString("photoUrl", "");
                                    Bundle bundle = new Bundle();
                                    bundle.putString("orgId", orgId);
                                    bundle.putInt("qpSn", qpSn);
                                    bundle.putInt("learnsn", sn);
                                    bundle.putInt("faceRecgMark", faceRecgMark);
                                    bundle.putString("photoUrl", photoUrl);
                                    startActivity(DailyTrainingExaminationItemActivity.class, bundle);
                                }
                            }
                        });
                    }
                } else if (rowsBean.getCheckMark() == 0) {


                    if (rowsBean.getFinishMark() == 1) {
                        tv_line_specified.setBackgroundResource(R.color.holetotal_yellow);
                        img_share.setVisibility(View.VISIBLE);
                        tv_yes.setText("已完成");
                        tv_yes.setBackgroundResource(R.drawable.shape_specified_yes);
                        tv_check.setVisibility(View.GONE);
//                            tv_check.setText("待审核");
//                            tv_check.setBackgroundResource(R.drawable.shape_specified_dai);
                        tv_sign.setVisibility(View.VISIBLE);
                        tv_sign.setText("未签名");
                        tv_sign.setBackgroundResource(R.drawable.shape_specified_noorange);
                        //    tv_specified_learning.setText("签名");

                        rlSpecifiedLearning.setOnClickListener(new View.OnClickListener() {
                            @Override
                            public void onClick(View view) {
                                if (Utils.isFastClicker()) {
                                    return;
                                }

                                int sn = rowsBean.getSn();
                                Bundle bundle = new Bundle();
                                bundle.putInt("sn", sn);
                                bundle.putString("signPicUrl", "");
                                bundle.putInt("signMark", signMark);
                                startActivity(SignActivity.class, bundle);
                            }
                        });

                    } else if (rowsBean.getFinishMark() == 2) {
                        tv_line_specified.setBackgroundResource(R.color.holetotal_yellow);
                        img_share.setVisibility(View.VISIBLE);
                        tv_yes.setText("已完成");
                        tv_yes.setBackgroundResource(R.drawable.shape_specified_yes);
                        tv_check.setVisibility(View.GONE);
//                            tv_check.setText("待审核");
//                            tv_check.setBackgroundResource(R.drawable.shape_specified_dai);
                        tv_sign.setVisibility(View.VISIBLE);
                        tv_sign.setText("已签名");
                        tv_sign.setBackgroundResource(R.drawable.shape_specified_yes);
                        //    tv_specified_learning.setText("查看签名");
                        rlSpecifiedLearning.setOnClickListener(new View.OnClickListener() {
                            @Override
                            public void onClick(View view) {
                                if (Utils.isFastClicker()) {
                                    return;
                                }
                                if (tv_specified_learning.getText().toString().trim().equals("查看签名")) {
                                    int sn = rowsBean.getSn();
                                    String signPicUrl = HelpUtil.judgeStrNull(rowsBean.getSignPicUrl());
                                    Bundle bundle = new Bundle();
                                    bundle.putInt("sn", sn);
                                    bundle.putString("signPicUrl", signPicUrl);
                                    bundle.putInt("signMark", signMark);
                                    startActivity(SignActivity.class, bundle);
                                } else if (tv_specified_learning.getText().toString().trim().equals("开始考试")) {
                                    int sn = rowsBean.getSn();
                                    SharedPreferences sp = getSharedPreferences("SpecifiedLearningHomeActivity",
                                            Context.MODE_PRIVATE);
                                    String orgId = sp.getString("orgId", "");
                                    int faceRecgMark = sp.getInt("faceRecgMark", 0);
                                    String photoUrl = sp.getString("photoUrl", "");
                                    Bundle bundle = new Bundle();
                                    bundle.putString("orgId", orgId);
                                    bundle.putInt("qpSn", qpSn);
                                    bundle.putInt("learnsn", sn);
                                    bundle.putInt("faceRecgMark", faceRecgMark);
                                    bundle.putString("photoUrl", photoUrl);
                                    startActivity(DailyTrainingExaminationItemActivity.class, bundle);
                                }
                            }
                        });

                    } else if (rowsBean.getFinishMark() == 0) {
//                            tv_line_specified.setBackgroundResource(R.color.specified_red);
//                            img_share.setVisibility(View.INVISIBLE);
//                            tv_yes.setText("未完成");
//                            tv_yes.setBackgroundResource(R.drawable.shape_specified_nored);
//                            tv_check.setVisibility(View.GONE);
//                            tv_sign.setVisibility(View.GONE);
                        rlSpecifiedLearning.setOnClickListener(new View.OnClickListener() {
                            @Override
                            public void onClick(View view) {//未完成
                                if (Utils.isFastClicker()) {
                                    return;
                                }
                                if (tv_specified_learning.getText().toString().equals("学习")) {
                                    SharedPreferences sp1 = getSharedPreferences("SpecifiedLearningHomeActivity", Context.MODE_PRIVATE);
                                    int feeType = sp1.getInt("feeType", 0);
                                    final float balance = sp1.getFloat("balance", 0);
                                    float satPrice = sp1.getFloat("satPrice", 0);
                                    int mtSeqMark = sp1.getInt("mtSeqMark", 0);
                                    int allowMuT = sp1.getInt("allowMuT", 0);
                                    final int chNo = rowsBean.getChNo();
                                    if (feeType == 2) {
                                        /*if (balance < chNo * satPrice) {
                                            TiShiDialog.Builder builder1 = new TiShiDialog.Builder(SpecifiedLearningHomeActivity.this);
                                            builder1.setMessage("您所属企业需要您自己付费学习，您当前余额" + balance + "元，学习花费" + chNo * satPrice + "元");
                                            builder1.setTitle("提示:");
                                            builder1.setPositiveButton("进入充值界面", new DialogInterface.OnClickListener() {
                                                public void onClick(DialogInterface dialog, int which) {
                                                    dialog.dismiss();
                                                    //设置你的操作事项
                                                    SharedPreferences sp = getSharedPreferences("SpecifiedLearningHomeActivity", Context.MODE_PRIVATE);
                                                    String orgId = sp.getString("orgId", "");
                                                    int diffentprice = chNo * satPrice - (int) balance;
                                                    Bundle bundle = new Bundle();
                                                    bundle.putString("orgId", orgId);
                                                    bundle.putInt("diffentprice", diffentprice);
                                                    startActivity(AccountbalanceActivity.class, bundle);
                                                }
                                            });
                                            builder1.setNegativeButton("取消",
                                                    new android.content.DialogInterface.OnClickListener() {
                                                        public void onClick(DialogInterface dialog, int which) {
                                                            dialog.dismiss();
                                                        }
                                                    });

                                            builder1.create().show();
                                            return;
                                        }*/
                                        int payMark = (rowsBean.getPayMark() == null) ? 0 : (int) rowsBean.getPayMark();
                                        int utchSn = rowsBean.getSn();

                                        JSONObject js_request = new JSONObject();//服务器需要传参的json对象
                                        try {
                                            js_request.put("userId", userId);//根据实际需求添加相应键值对
                                            js_request.put("orgId", orgId);
                                            js_request.put("setYm",rowsBean.getStatYm() );
                                        } catch (JSONException e) {
                                            e.printStackTrace();
                                        }
                                        RequestParams params = new RequestParams(AppInterfaceConfig.BASE_URL + "sys/userVip/check");
                                        params.setAsJsonContent(true);
                                        params.setBodyContent(js_request.toString());
                                        LogUtils.e("测试", "onClick: "+js_request.toString() );
                                        x.http().post(params, new Callback.CommonCallback<String>() {
                                            @Override
                                            public void onSuccess(String result) {
                                                UserVipCheckBean bean = JSON.parseObject(result, UserVipCheckBean.class);
                                                boolean checkResult = bean.isResult();
                                                if (checkResult) { //在会员期内
                                                    new Login().useTcHourUpdatePayMark(utchSn + "", "2", SpecifiedLearningHomeActivity.this, 5);
                                                } else {
                                                    if (payMark == 0) {
                                                        if (buyMember) { //需要买会员
                                                            TiShiDialog.Builder builder1 = new TiShiDialog.Builder(SpecifiedLearningHomeActivity.this);
                                                            builder1.setMessage("您所属企业需购买包月会员");
                                                            builder1.setTitle("提示:");
                                                            builder1.setPositiveButton("买会员", new DialogInterface.OnClickListener() {
                                                                public void onClick(DialogInterface dialog, int which) {
                                                                    dialog.dismiss();
                                                                    //startActivity(MemberInfoActivity.class, null);
                                                                   // startActivity(MemberMsgActivity.class, null);
                                                                }
                                                            });
                                                            builder1.setNegativeButton("取消", new android.content.DialogInterface.OnClickListener() {
                                                                public void onClick(DialogInterface dialog, int which) {
                                                                    dialog.dismiss();
                                                                }
                                                            });

                                                            builder1.create().show();
                                                            return;
                                                        } else {
                                                            TiShiDialog.Builder builder1 = new TiShiDialog.Builder(SpecifiedLearningHomeActivity.this);
                                                            builder1.setMessage("您所属企业需要您自己付费学习，您当前余额" + balance + "元，学习花费" + chNo * satPrice + "元");
                                                            builder1.setTitle("提示:");
                                                            builder1.setPositiveButton("去付费", new DialogInterface.OnClickListener() {
                                                                public void onClick(DialogInterface dialog, int which) {
                                                                    dialog.dismiss();
                                                                    //设置你的操作事项
                                                                    SharedPreferences sp = getSharedPreferences("SpecifiedLearningHomeActivity", Context.MODE_PRIVATE);
                                                                    String orgId = sp.getString("orgId", "");//总支付金额
                                                                    double diffentprice = Double.valueOf(chNo * satPrice) - Double.valueOf(balance); //还需支付费用
                                                                    Bundle bundle = new Bundle();
                                                                    bundle.putString("orgId", orgId);
                                                                    bundle.putInt("utchSn", utchSn);
                                                                    bundle.putDouble("amount", chNo * satPrice);
                                                                    bundle.putDouble("balance", balance);
                                                                    bundle.putString("chName", chName);
                                                                    startActivity(SpecifiedLearningPayActivity.class, bundle);
                                                                }
                                                            });
                                                            builder1.setNegativeButton("取消",
                                                                    new android.content.DialogInterface.OnClickListener() {
                                                                        public void onClick(DialogInterface dialog, int which) {
                                                                            dialog.dismiss();
                                                                        }
                                                                    });

                                                            builder1.create().show();
                                                            return;
                                                        }
                                                    }
                                                }
                                                int Mark = sp1.getInt("Mark", 0);
                                                int photoMark = sp1.getInt("photoMark", 0);
                                                int signMark = sp1.getInt("signMark", 0);
                                                int minPer = sp1.getInt("minPer", 0);
                                                int readInterval = sp1.getInt("readInterval", 0);
                                                int faceRecgMark = sp1.getInt("faceRecgMark", 0);
                                                String orgId = sp1.getString("orgId", "");
                                                String forbidHour = sp1.getString("forbidHour", "");
                                                String photoUrl = sp1.getString("photoUrl", "");
                                                int sn = rowsBean.getSn();
                                                String statYm = rowsBean.getStatYm();
                                                int actualChLength = rowsBean.getActualChLength();
                                                int setChLength = 0;
                                                setChLength = (rowsBean.getMiNo() > rowsBean.getSetChLength()) ? rowsBean.getMiNo() : rowsBean.getSetChLength();
                                                int checkMark = rowsBean.getCheckMark();
                                                int finishMark = rowsBean.getFinishMark();
                                                Integer qpSn = rowsBean.getQpSn();
                                                if (mtSeqMark == 1) {
                                                    DateFormat df = new SimpleDateFormat("yyyy-MM");
                                                    //  List<SpecifiedLearnIngHomeBean.RowsBean> rowList = getDataList();
                                                    specifielist.clear();
                                                    for (int i = 0; i < rowList.size(); i++) {
                                                        try {
                                                            if (df.parse(rowList.get(i).getStatYm()).getTime() < df.parse(statYm).getTime()) {
                                                                specifielist.add(rowList.get(i));
                                                            }
                                                        } catch (ParseException e) {
                                                            e.printStackTrace();
                                                        }
                                                    }
                                                    specifielist1.clear();
                                                    for (int i = 0; i < specifielist.size(); i++) {
                                                        if (specifielist.get(i).getFinishMark() == 0) {
                                                            specifielist1.add(specifielist.get(i));
                                                        }
                                                    }
                                                    if (specifielist1.size() > 0) {
                                                        TiShiDialog.Builder builder1 = new TiShiDialog.Builder(SpecifiedLearningHomeActivity.this);
                                                        builder1.setMessage("请先学习上月或以往未完成月份的日常培训");
                                                        builder1.setTitle("提示:");
                                                        builder1.setPositiveButton("我知道", new DialogInterface.OnClickListener() {
                                                            public void onClick(DialogInterface dialog, int which) {
                                                                dialog.dismiss();
                                                                //设置你的操作事项
                                                            }
                                                        });
                                                        builder1.create().show();
                                                        return;
                                                    }
                                                    Bundle bundle = new Bundle();
                                                    bundle.putInt("Mark", Mark);
                                                    bundle.putInt("photoMark", photoMark);
                                                    bundle.putInt("signMark", signMark);
                                                    bundle.putInt("minPer", minPer);
                                                    bundle.putInt("readInterval", readInterval);
                                                    bundle.putString("orgId", orgId);
                                                    bundle.putInt("sn", sn);
                                                    bundle.putString("statYm", statYm);
                                                    bundle.putString("forbidHour", forbidHour);
                                                    bundle.putString("chName", chName);
                                                    bundle.putInt("actualChLength", actualChLength);
                                                    bundle.putInt("setChLength", setChLength);
                                                    bundle.putInt("checkMark", checkMark);
                                                    bundle.putInt("finishMark", finishMark);
                                                    bundle.putInt("faceRecgMark", faceRecgMark);
                                                    bundle.putString("photoUrl", photoUrl);
                                                    bundle.putInt("chNo", chNo);
                                                    bundle.putInt("allowMuT", allowMuT);
                                                    bundle.putInt("rtype", otpSn);
                                                    bundle.putInt("qnSn",qnSn);
                                                    if (qpSn == null) {
                                                        bundle.putInt("qpSn", 0);
                                                    } else {
                                                        bundle.putInt("qpSn", qpSn);
                                                    }
                                                    startActivity(SubSpecifiedLearningHome1Activity.class, bundle);
                                                } else if (mtSeqMark == 0) {
                                                    Bundle bundle = new Bundle();
                                                    bundle.putInt("Mark", Mark);
                                                    bundle.putInt("photoMark", photoMark);
                                                    bundle.putInt("signMark", signMark);
                                                    bundle.putInt("minPer", minPer);
                                                    bundle.putInt("readInterval", readInterval);
                                                    bundle.putString("orgId", orgId);
                                                    bundle.putInt("sn", sn);
                                                    bundle.putString("statYm", statYm);
                                                    bundle.putString("forbidHour", forbidHour);
                                                    bundle.putString("chName", chName);
                                                    bundle.putInt("actualChLength", actualChLength);
                                                    bundle.putInt("setChLength", setChLength);
                                                    bundle.putInt("checkMark", checkMark);
                                                    bundle.putInt("finishMark", finishMark);
                                                    bundle.putInt("faceRecgMark", faceRecgMark);
                                                    bundle.putString("photoUrl", photoUrl);
                                                    bundle.putInt("chNo", chNo);
                                                    bundle.putInt("allowMuT", allowMuT);
                                                    bundle.putInt("rtype", otpSn);
                                                    bundle.putInt("qnSn",qnSn);
                                                    if (qpSn == null) {
                                                        bundle.putInt("qpSn", 0);
                                                    } else {
                                                        bundle.putInt("qpSn", qpSn);
                                                    }
                                                    startActivity(SubSpecifiedLearningHome1Activity.class, bundle);
                                                }
                                            }

                                            @Override
                                            public void onError(Throwable ex, boolean isOnCallback) {

                                            }

                                            @Override
                                            public void onCancelled(CancelledException cex) {

                                            }

                                            @Override
                                            public void onFinished() {

                                            }
                                        });
                                    } else if (feeType == 1) {//免费
                                        int Mark = sp1.getInt("Mark", 0);
                                        int photoMark = sp1.getInt("photoMark", 0);
                                        int signMark = sp1.getInt("signMark", 0);
                                        int minPer = sp1.getInt("minPer", 0);
                                        int readInterval = sp1.getInt("readInterval", 0);
                                        int faceRecgMark = sp1.getInt("faceRecgMark", 0);
                                        String orgId = sp1.getString("orgId", "");
                                        String forbidHour = sp1.getString("forbidHour", "");
                                        String photoUrl = sp1.getString("photoUrl", "");
                                        int sn = rowsBean.getSn();
                                        String statYm = rowsBean.getStatYm();
                                        int actualChLength = rowsBean.getActualChLength();
                                        int setChLength = 0;
                                        setChLength = (rowsBean.getMiNo() > rowsBean.getSetChLength()) ? rowsBean.getMiNo() : rowsBean.getSetChLength();
                                        int checkMark = rowsBean.getCheckMark();
                                        int finishMark = rowsBean.getFinishMark();
                                        Integer qpSn = rowsBean.getQpSn();
                                        if (mtSeqMark == 1) {
                                            DateFormat df = new SimpleDateFormat("yyyy-MM");
                                            //   List<SpecifiedLearnIngHomeBean.RowsBean> rowList = getDataList();
                                            specifielist.clear();
                                            for (int i = 0; i < rowList.size(); i++) {
                                                try {
                                                    if (df.parse(rowList.get(i).getStatYm()).getTime() < df.parse(statYm).getTime()) {
                                                        specifielist.add(rowList.get(i));
                                                    }
                                                } catch (ParseException e) {
                                                    e.printStackTrace();
                                                }
                                            }
                                            specifielist1.clear();
                                            for (int i = 0; i < specifielist.size(); i++) {
                                                if (specifielist.get(i).getFinishMark() == 0) {
                                                    specifielist1.add(specifielist.get(i));
                                                }
                                            }
                                            if (specifielist1.size() > 0) {
                                                TiShiDialog.Builder builder1 = new TiShiDialog.Builder(SpecifiedLearningHomeActivity.this);
                                                builder1.setMessage("请先学习上月或以往未完成月份的日常培训");
                                                builder1.setTitle("提示:");
                                                builder1.setPositiveButton("我知道", new DialogInterface.OnClickListener() {
                                                    public void onClick(DialogInterface dialog, int which) {
                                                        dialog.dismiss();
                                                        //设置你的操作事项
                                                    }
                                                });
                                                builder1.create().show();

                                                return;
                                            }
                                            Bundle bundle = new Bundle();
                                            bundle.putInt("Mark", Mark);
                                            bundle.putInt("photoMark", photoMark);
                                            bundle.putInt("signMark", signMark);
                                            bundle.putInt("minPer", minPer);
                                            bundle.putInt("readInterval", readInterval);
                                            bundle.putString("orgId", orgId);
                                            bundle.putInt("sn", sn);
                                            bundle.putString("statYm", statYm);
                                            bundle.putString("forbidHour", forbidHour);
                                            bundle.putString("chName", chName);
                                            bundle.putInt("actualChLength", actualChLength);
                                            bundle.putInt("setChLength", setChLength);
                                            bundle.putInt("checkMark", checkMark);
                                            bundle.putInt("finishMark", finishMark);
                                            bundle.putInt("faceRecgMark", faceRecgMark);
                                            bundle.putString("photoUrl", photoUrl);
                                            bundle.putInt("chNo", chNo);
                                            bundle.putInt("allowMuT", allowMuT);
                                            bundle.putInt("rtype", otpSn);
                                            bundle.putInt("qnSn",qnSn);
                                            if (qpSn == null) {
                                                bundle.putInt("qpSn", 0);
                                            } else {
                                                bundle.putInt("qpSn", qpSn);
                                            }
                                            startActivity(SubSpecifiedLearningHome1Activity.class, bundle);
                                        } else if (mtSeqMark == 0) {
                                            Bundle bundle = new Bundle();
                                            bundle.putInt("Mark", Mark);
                                            bundle.putInt("photoMark", photoMark);
                                            bundle.putInt("signMark", signMark);
                                            bundle.putInt("minPer", minPer);
                                            bundle.putInt("readInterval", readInterval);
                                            bundle.putString("orgId", orgId);
                                            bundle.putInt("sn", sn);
                                            bundle.putString("statYm", statYm);
                                            bundle.putString("forbidHour", forbidHour);
                                            bundle.putString("chName", chName);
                                            bundle.putInt("actualChLength", actualChLength);
                                            bundle.putInt("setChLength", setChLength);
                                            bundle.putInt("checkMark", checkMark);
                                            bundle.putInt("finishMark", finishMark);
                                            bundle.putInt("faceRecgMark", faceRecgMark);
                                            bundle.putString("photoUrl", photoUrl);
                                            bundle.putInt("chNo", chNo);
                                            bundle.putInt("allowMuT", allowMuT);
                                            bundle.putInt("rtype", otpSn);
                                            bundle.putInt("qnSn",qnSn);
                                            if (qpSn == null) {
                                                bundle.putInt("qpSn", 0);
                                            } else {

                                                bundle.putInt("qpSn", qpSn);
                                            }
                                            startActivity(SubSpecifiedLearningHome1Activity.class, bundle);
                                        }
                                    }

                                } else if (tv_specified_learning.getText().toString().equals("开始考试")) {
                                    int sn = rowsBean.getSn();
                                    SharedPreferences sp = getSharedPreferences("SpecifiedLearningHomeActivity",
                                            Context.MODE_PRIVATE);
                                    String orgId = sp.getString("orgId", "");
                                    int faceRecgMark = sp.getInt("faceRecgMark", 0);
                                    String photoUrl = sp.getString("photoUrl", "");
                                    Bundle bundle = new Bundle();
                                    bundle.putString("orgId", orgId);
                                    bundle.putInt("qpSn", qpSn);
                                    bundle.putInt("learnsn", sn);
                                    bundle.putInt("faceRecgMark", faceRecgMark);
                                    bundle.putString("photoUrl", photoUrl);
                                    startActivity(DailyTrainingExaminationItemActivity.class, bundle);

                                }

                            }
                        });

                    }
                }
            } else if (signMark == 0) {
                String signPicUrl = HelpUtil.judgeStrNull(rowsBean.getSignPicUrl());
                if (rowsBean.getCheckMark() == 2) {
                    tv_line_specified.setBackgroundResource(R.color.specified_red);
                    img_share.setVisibility(View.VISIBLE);
                    tv_check.setVisibility(View.VISIBLE);
                    tv_check.setText("审核未通过");
                    tv_check.setBackgroundResource(R.drawable.shape_specified_nored);
                    tv_yes.setText("已完成");
                    tv_yes.setBackgroundResource(R.drawable.shape_specified_yes);
                    if (signPicUrl.equals("")) {
                        tv_sign.setVisibility(View.GONE);

                        rlSpecifiedLearning.setOnClickListener(new View.OnClickListener() {
                            @Override
                            public void onClick(View view) {
                                if (Utils.isFastClicker()) {
                                    return;
                                }
                                if (tv_specified_learning.getText().toString().equals("开始考试")) {
                                    int sn = rowsBean.getSn();
                                    SharedPreferences sp = getSharedPreferences("SpecifiedLearningHomeActivity",
                                            Context.MODE_PRIVATE);
                                    String orgId = sp.getString("orgId", "");
                                    int faceRecgMark = sp.getInt("faceRecgMark", 0);
                                    String photoUrl = sp.getString("photoUrl", "");
                                    Bundle bundle = new Bundle();
                                    bundle.putString("orgId", orgId);
                                    bundle.putInt("qpSn", qpSn);
                                    bundle.putInt("learnsn", sn);
                                    bundle.putInt("faceRecgMark", faceRecgMark);
                                    bundle.putString("photoUrl", photoUrl);
                                    startActivity(DailyTrainingExaminationItemActivity.class, bundle);

                                }

                            }
                        });
                    } else {
                        tv_sign.setVisibility(View.VISIBLE);
                        tv_sign.setText("已签名");
                        tv_sign.setBackgroundResource(R.drawable.shape_specified_yes);
                        rlSpecifiedLearning.setOnClickListener(new View.OnClickListener() {
                            @Override
                            public void onClick(View view) {
                                if (Utils.isFastClicker()) {
                                    return;
                                }
                                if (tv_specified_learning.getText().toString().equals("查看签名")) {
                                    int sn = rowsBean.getSn();
                                    Bundle bundle = new Bundle();
                                    bundle.putInt("sn", sn);
                                    bundle.putString("signPicUrl", signPicUrl);
                                    bundle.putInt("signMark", signMark);
                                    startActivity(SignActivity.class, bundle);

                                } else if (tv_specified_learning.getText().toString().equals("开始考试")) {
                                    int sn = rowsBean.getSn();
                                    SharedPreferences sp = getSharedPreferences("SpecifiedLearningHomeActivity",
                                            Context.MODE_PRIVATE);
                                    String orgId = sp.getString("orgId", "");
                                    int faceRecgMark = sp.getInt("faceRecgMark", 0);
                                    String photoUrl = sp.getString("photoUrl", "");
                                    Bundle bundle = new Bundle();
                                    bundle.putString("orgId", orgId);
                                    bundle.putInt("qpSn", qpSn);
                                    bundle.putInt("learnsn", sn);
                                    bundle.putInt("faceRecgMark", faceRecgMark);
                                    bundle.putString("photoUrl", photoUrl);
                                    startActivity(DailyTrainingExaminationItemActivity.class, bundle);

                                }
                            }
                        });
                    }
                } else if (rowsBean.getCheckMark() == 1) {
                    tv_line_specified.setBackgroundResource(R.color.holetotal_gray);
                    img_share.setVisibility(View.VISIBLE);
                    tv_check.setVisibility(View.GONE);
                    tv_yes.setText("已完成");
                    tv_yes.setBackgroundResource(R.drawable.shape_specified_yes);


                    if (signPicUrl.equals("")) {
                        tv_sign.setVisibility(View.GONE);
                        rlSpecifiedLearning.setOnClickListener(new View.OnClickListener() {
                            @Override
                            public void onClick(View view) {
                                if (Utils.isFastClicker()) {
                                    return;
                                }
                                if (tv_specified_learning.getText().toString().equals("开始考试")) {
                                    int sn = rowsBean.getSn();
                                    SharedPreferences sp = getSharedPreferences("SpecifiedLearningHomeActivity",
                                            Context.MODE_PRIVATE);
                                    String orgId = sp.getString("orgId", "");
                                    int faceRecgMark = sp.getInt("faceRecgMark", 0);
                                    String photoUrl = sp.getString("photoUrl", "");
                                    Bundle bundle = new Bundle();
                                    bundle.putString("orgId", orgId);
                                    bundle.putInt("qpSn", qpSn);
                                    bundle.putInt("learnsn", sn);
                                    bundle.putInt("faceRecgMark", faceRecgMark);
                                    bundle.putString("photoUrl", photoUrl);
                                    startActivity(DailyTrainingExaminationItemActivity.class, bundle);

                                }

                            }
                        });
                    } else {
                        tv_sign.setVisibility(View.VISIBLE);
                        tv_sign.setText("已签名");
                        tv_sign.setBackgroundResource(R.drawable.shape_specified_yes);
                        rlSpecifiedLearning.setOnClickListener(new View.OnClickListener() {
                            @Override
                            public void onClick(View view) {
                                if (Utils.isFastClicker()) {
                                    return;
                                }
                                if (tv_specified_learning.getText().toString().equals("查看签名")) {
                                    int sn = rowsBean.getSn();
                                    Bundle bundle = new Bundle();
                                    bundle.putInt("sn", sn);
                                    bundle.putString("signPicUrl", signPicUrl);
                                    bundle.putInt("signMark", signMark);
                                    startActivity(SignActivity.class, bundle);
                                } else if (tv_specified_learning.getText().toString().equals("开始考试")) {
                                    int sn = rowsBean.getSn();
                                    SharedPreferences sp = getSharedPreferences("SpecifiedLearningHomeActivity",
                                            Context.MODE_PRIVATE);
                                    String orgId = sp.getString("orgId", "");
                                    int faceRecgMark = sp.getInt("faceRecgMark", 0);
                                    String photoUrl = sp.getString("photoUrl", "");
                                    Bundle bundle = new Bundle();
                                    bundle.putString("orgId", orgId);
                                    bundle.putInt("qpSn", qpSn);
                                    bundle.putInt("learnsn", sn);
                                    bundle.putInt("faceRecgMark", faceRecgMark);
                                    bundle.putString("photoUrl", photoUrl);
                                    startActivity(DailyTrainingExaminationItemActivity.class, bundle);

                                }
                            }
                        });
                    }
                } else if (rowsBean.getCheckMark() == 0) {
                    if (rowsBean.getFinishMark() == 1) {
                        tv_line_specified.setBackgroundResource(R.color.holetotal_yellow);
                        img_share.setVisibility(View.VISIBLE);
                        tv_yes.setText("已完成");
                        tv_yes.setBackgroundResource(R.drawable.shape_specified_yes);
                        tv_check.setVisibility(View.GONE);
                        tv_sign.setVisibility(View.GONE);
                    } else if (rowsBean.getFinishMark() == 2) {
                        tv_line_specified.setBackgroundResource(R.color.holetotal_yellow);
                        img_share.setVisibility(View.VISIBLE);
                        tv_yes.setText("已完成");
                        tv_yes.setBackgroundResource(R.drawable.shape_specified_yes);
                        tv_check.setVisibility(View.GONE);
                        tv_sign.setVisibility(View.VISIBLE);
                        tv_sign.setText("已签名");
                        tv_sign.setBackgroundResource(R.drawable.shape_specified_yes);
                        rlSpecifiedLearning.setOnClickListener(new View.OnClickListener() {
                            @Override
                            public void onClick(View view) {
                                if (Utils.isFastClicker()) {
                                    return;
                                }

                                if (tv_specified_learning.getText().toString().equals("查看签名")) {
                                    int sn = rowsBean.getSn();
                                    Bundle bundle = new Bundle();
                                    bundle.putInt("sn", sn);
                                    bundle.putString("signPicUrl", signPicUrl);
                                    bundle.putInt("signMark", signMark);
                                    startActivity(SignActivity.class, bundle);
                                } else if (tv_specified_learning.getText().toString().equals("开始考试")) {
                                    int sn = rowsBean.getSn();
                                    SharedPreferences sp = getSharedPreferences("SpecifiedLearningHomeActivity",
                                            Context.MODE_PRIVATE);
                                    String orgId = sp.getString("orgId", "");
                                    int faceRecgMark = sp.getInt("faceRecgMark", 0);
                                    String photoUrl = sp.getString("photoUrl", "");
                                    Bundle bundle = new Bundle();
                                    bundle.putString("orgId", orgId);
                                    bundle.putInt("qpSn", qpSn);
                                    bundle.putInt("learnsn", sn);
                                    bundle.putInt("faceRecgMark", faceRecgMark);
                                    bundle.putString("photoUrl", photoUrl);
                                    startActivity(DailyTrainingExaminationItemActivity.class, bundle);

                                }
                            }
                        });

                    } else if (rowsBean.getFinishMark() == 0) {
                        rlSpecifiedLearning.setOnClickListener(new View.OnClickListener() {
                            @Override
                            public void onClick(View view) {

                                if (Utils.isFastClicker()) {
                                    return;
                                }
                                if (tv_specified_learning.getText().toString().equals("学习")) {
                                    SharedPreferences sp1 = getSharedPreferences("SpecifiedLearningHomeActivity", Context.MODE_PRIVATE);
                                    int feeType = sp1.getInt("feeType", 0);
                                    final float balance = sp1.getFloat("balance", 0);
                                    float satPrice = sp1.getFloat("satPrice", 0);
                                    int mtSeqMark = sp1.getInt("mtSeqMark", 0);
                                    int allowMuT = sp1.getInt("allowMuT", 0);
                                    final int chNo = rowsBean.getChNo();
                                    if (feeType == 2) {
                                        int payMark = (rowsBean.getPayMark() == null) ? 0 : (int) rowsBean.getPayMark();
                                        int utchSn = rowsBean.getSn();

                                        JSONObject js_request = new JSONObject();//服务器需要传参的json对象
                                        try {
                                            js_request.put("userId", userId);//根据实际需求添加相应键值对
                                            js_request.put("orgId", orgId);
                                            js_request.put("setYm",rowsBean.getStatYm() );
                                        } catch (JSONException e) {
                                            e.printStackTrace();
                                        }
                                        RequestParams params = new RequestParams(AppInterfaceConfig.BASE_URL + "sys/userVip/check");
                                        params.setAsJsonContent(true);
                                        params.setBodyContent(js_request.toString());
                                        LogUtils.e("测试", "onClick: "+js_request.toString() );
                                        x.http().post(params, new Callback.CommonCallback<String>() {
                                            @Override
                                            public void onSuccess(String result) {
                                                UserVipCheckBean bean = JSON.parseObject(result, UserVipCheckBean.class);
                                                boolean checkResult = bean.isResult();
                                                if (checkResult) {
                                                    new Login().useTcHourUpdatePayMark(utchSn + "", "2", SpecifiedLearningHomeActivity.this, 5);
                                                } else {
                                                    if (payMark == 0) {
                                                        TiShiDialog.Builder builder1 = new TiShiDialog.Builder(SpecifiedLearningHomeActivity.this);
                                                        builder1.setMessage("您所属企业需要您自己付费学习，您当前余额" + balance + "元，学习花费" + chNo * satPrice + "元");
                                                        builder1.setTitle("提示:");
                                                        builder1.setPositiveButton("去付费", new DialogInterface.OnClickListener() {
                                                            public void onClick(DialogInterface dialog, int which) {
                                                                dialog.dismiss();
                                                                //设置你的操作事项
                                                                SharedPreferences sp = getSharedPreferences("SpecifiedLearningHomeActivity", Context.MODE_PRIVATE);
                                                                String orgId = sp.getString("orgId", "");//总支付金额
                                                                double diffentprice = Double.valueOf(chNo * satPrice) - Double.valueOf(balance); //还需支付费用
                                                                Bundle bundle = new Bundle();
                                                                bundle.putString("orgId", orgId);
                                                                bundle.putInt("utchSn", utchSn);
                                                                bundle.putDouble("amount", chNo * satPrice);
                                                                bundle.putDouble("balance", balance);
                                                                bundle.putString("chName", chName);
                                                                startActivity(SpecifiedLearningPayActivity.class, bundle);
                                                            }
                                                        });
                                                        builder1.setNegativeButton("取消",
                                                                new android.content.DialogInterface.OnClickListener() {
                                                                    public void onClick(DialogInterface dialog, int which) {
                                                                        dialog.dismiss();
                                                                    }
                                                                });

                                                        builder1.create().show();
                                                        return;
                                                    }
                                                }
                                            }

                                            @Override
                                            public void onError(Throwable ex, boolean isOnCallback) {

                                            }

                                            @Override
                                            public void onCancelled(CancelledException cex) {

                                            }

                                            @Override
                                            public void onFinished() {

                                            }
                                        });

                                        int Mark = sp1.getInt("Mark", 0);
                                        int photoMark = sp1.getInt("photoMark", 0);
                                        int signMark = sp1.getInt("signMark", 0);
                                        int minPer = sp1.getInt("minPer", 0);
                                        int readInterval = sp1.getInt("readInterval", 0);
                                        int faceRecgMark = sp1.getInt("faceRecgMark", 0);
                                        String orgId = sp1.getString("orgId", "");
                                        String forbidHour = sp1.getString("forbidHour", "");
                                        String photoUrl = sp1.getString("photoUrl", "");
                                        int sn = rowsBean.getSn();
                                        String statYm = rowsBean.getStatYm();
                                        int actualChLength = rowsBean.getActualChLength();
                                        int setChLength = 0;
                                        setChLength = (rowsBean.getMiNo() > rowsBean.getSetChLength()) ? rowsBean.getMiNo() : rowsBean.getSetChLength();
                                        int checkMark = rowsBean.getCheckMark();
                                        int finishMark = rowsBean.getFinishMark();
                                        Integer qpSn = rowsBean.getQpSn();
                                        if (mtSeqMark == 1) {
                                            DateFormat df = new SimpleDateFormat("yyyy-MM");
                                            //  List<SpecifiedLearnIngHomeBean.RowsBean> rowList = getDataList();
                                            specifielist.clear();
                                            for (int i = 0; i < rowList.size(); i++) {
                                                try {
                                                    if (df.parse(rowList.get(i).getStatYm()).getTime() < df.parse(statYm).getTime()) {
                                                        specifielist.add(rowList.get(i));
                                                    }
                                                } catch (ParseException e) {
                                                    e.printStackTrace();
                                                }
                                            }
                                            specifielist1.clear();
                                            for (int i = 0; i < specifielist.size(); i++) {
                                                if (specifielist.get(i).getFinishMark() == 0) {
                                                    specifielist1.add(specifielist.get(i));
                                                }
                                            }
                                            if (specifielist1.size() > 0) {
                                                TiShiDialog.Builder builder1 = new TiShiDialog.Builder(SpecifiedLearningHomeActivity.this);
                                                builder1.setMessage("请先学习上月或以往未完成月份的日常培训");
                                                builder1.setTitle("提示:");
                                                builder1.setPositiveButton("我知道", new DialogInterface.OnClickListener() {
                                                    public void onClick(DialogInterface dialog, int which) {
                                                        dialog.dismiss();
                                                        ;
                                                        //设置你的操作事项
                                                    }
                                                });
                                                builder1.create().show();

                                                return;
                                            }
                                            Bundle bundle = new Bundle();
                                            bundle.putInt("Mark", Mark);
                                            bundle.putInt("photoMark", photoMark);
                                            bundle.putInt("signMark", signMark);
                                            bundle.putInt("minPer", minPer);
                                            bundle.putInt("readInterval", readInterval);
                                            bundle.putString("orgId", orgId);
                                            bundle.putString("chName", chName);
                                            bundle.putInt("sn", sn);
                                            bundle.putString("statYm", statYm);
                                            bundle.putString("forbidHour", forbidHour);
                                            bundle.putInt("actualChLength", actualChLength);
                                            bundle.putInt("setChLength", setChLength);
                                            bundle.putInt("checkMark", checkMark);
                                            bundle.putInt("finishMark", finishMark);
                                            bundle.putInt("faceRecgMark", faceRecgMark);
                                            bundle.putString("photoUrl", photoUrl);
                                            bundle.putInt("chNo", chNo);
                                            bundle.putInt("allowMuT", allowMuT);
                                            bundle.putInt("rtype", otpSn);
                                            bundle.putInt("qnSn",qnSn);
                                            if (qpSn == null) {
                                                bundle.putInt("qpSn", 0);
                                            } else {

                                                bundle.putInt("qpSn", qpSn);
                                            }
                                            startActivity(SubSpecifiedLearningHome1Activity.class, bundle);
                                        } else if (mtSeqMark == 0) {
                                            Bundle bundle = new Bundle();
                                            bundle.putInt("Mark", Mark);
                                            bundle.putInt("photoMark", photoMark);
                                            bundle.putInt("signMark", signMark);
                                            bundle.putInt("minPer", minPer);
                                            bundle.putInt("readInterval", readInterval);
                                            bundle.putString("orgId", orgId);
                                            bundle.putString("chName", chName);
                                            bundle.putInt("sn", sn);
                                            bundle.putString("statYm", statYm);
                                            bundle.putString("forbidHour", forbidHour);
                                            bundle.putInt("actualChLength", actualChLength);
                                            bundle.putInt("setChLength", setChLength);
                                            bundle.putInt("checkMark", checkMark);
                                            bundle.putInt("finishMark", finishMark);
                                            bundle.putInt("faceRecgMark", faceRecgMark);
                                            bundle.putString("photoUrl", photoUrl);
                                            bundle.putInt("chNo", chNo);
                                            bundle.putInt("allowMuT", allowMuT);
                                            bundle.putInt("rtype", otpSn);
                                            bundle.putInt("qnSn",qnSn);
                                            if (qpSn == null) {
                                                bundle.putInt("qpSn", 0);
                                            } else {

                                                bundle.putInt("qpSn", qpSn);
                                            }
                                            startActivity(SubSpecifiedLearningHome1Activity.class, bundle);
                                        }
                                    } else if (feeType == 1) {
                                        int Mark = sp1.getInt("Mark", 0);
                                        int photoMark = sp1.getInt("photoMark", 0);
                                        int signMark = sp1.getInt("signMark", 0);
                                        int minPer = sp1.getInt("minPer", 0);
                                        int readInterval = sp1.getInt("readInterval", 0);
                                        int faceRecgMark = sp1.getInt("faceRecgMark", 0);
                                        String orgId = sp1.getString("orgId", "");
                                        String forbidHour = sp1.getString("forbidHour", "");
                                        String photoUrl = sp1.getString("photoUrl", "");
                                        int sn = rowsBean.getSn();
                                        String statYm = rowsBean.getStatYm();
                                        int actualChLength = rowsBean.getActualChLength();
                                        int setChLength = 0;
                                        setChLength = (rowsBean.getMiNo() > rowsBean.getSetChLength()) ? rowsBean.getMiNo() : rowsBean.getSetChLength();
                                        int checkMark = rowsBean.getCheckMark();
                                        int finishMark = rowsBean.getFinishMark();
                                        Integer qpSn = rowsBean.getQpSn();
                                        if (mtSeqMark == 1) {
                                            DateFormat df = new SimpleDateFormat("yyyy-MM");
                                            //   List<SpecifiedLearnIngHomeBean.RowsBean> rowList = getDataList();
                                            specifielist.clear();
                                            for (int i = 0; i < rowList.size(); i++) {
                                                try {
                                                    if (df.parse(rowList.get(i).getStatYm()).getTime() < df.parse(statYm).getTime()) {
                                                        specifielist.add(rowList.get(i));
                                                    }
                                                } catch (ParseException e) {
                                                    e.printStackTrace();
                                                }
                                            }
                                            specifielist1.clear();
                                            for (int i = 0; i < specifielist.size(); i++) {
                                                if (specifielist.get(i).getFinishMark() == 0) {
                                                    specifielist1.add(specifielist.get(i));
                                                }
                                            }
                                            if (specifielist1.size() > 0) {
                                                TiShiDialog.Builder builder1 = new TiShiDialog.Builder(SpecifiedLearningHomeActivity.this);
                                                builder1.setMessage("请先学习上月或以往未完成月份的日常培训");
                                                builder1.setTitle("提示:");
                                                builder1.setPositiveButton("我知道", new DialogInterface.OnClickListener() {
                                                    public void onClick(DialogInterface dialog, int which) {
                                                        dialog.dismiss();
                                                        ;
                                                        //设置你的操作事项
                                                    }
                                                });
                                                builder1.create().show();
                                                return;
                                            }

                                            Bundle bundle = new Bundle();
                                            bundle.putInt("Mark", Mark);
                                            bundle.putInt("photoMark", photoMark);
                                            bundle.putInt("signMark", signMark);
                                            bundle.putInt("minPer", minPer);
                                            bundle.putInt("readInterval", readInterval);
                                            bundle.putString("orgId", orgId);
                                            bundle.putString("chName", chName);
                                            bundle.putInt("sn", sn);
                                            bundle.putString("statYm", statYm);
                                            bundle.putString("forbidHour", forbidHour);
                                            bundle.putInt("actualChLength", actualChLength);
                                            bundle.putInt("setChLength", setChLength);
                                            bundle.putInt("checkMark", checkMark);
                                            bundle.putInt("finishMark", finishMark);
                                            bundle.putInt("faceRecgMark", faceRecgMark);
                                            bundle.putString("photoUrl", photoUrl);
                                            bundle.putInt("chNo", chNo);
                                            bundle.putInt("allowMuT", allowMuT);
                                            bundle.putInt("rtype", otpSn);
                                            bundle.putInt("qnSn",qnSn);
                                            if (qpSn == null) {
                                                bundle.putInt("qpSn", 0);
                                            } else {

                                                bundle.putInt("qpSn", qpSn);
                                            }
                                            startActivity(SubSpecifiedLearningHome1Activity.class, bundle);

                                        } else if (mtSeqMark == 0) {
                                            Bundle bundle = new Bundle();
                                            bundle.putInt("Mark", Mark);
                                            bundle.putInt("photoMark", photoMark);
                                            bundle.putInt("signMark", signMark);
                                            bundle.putInt("minPer", minPer);
                                            bundle.putInt("readInterval", readInterval);
                                            bundle.putString("orgId", orgId);
                                            bundle.putString("chName", chName);
                                            bundle.putInt("sn", sn);
                                            bundle.putString("statYm", statYm);
                                            bundle.putString("forbidHour", forbidHour);
                                            bundle.putInt("actualChLength", actualChLength);
                                            bundle.putInt("setChLength", setChLength);
                                            bundle.putInt("checkMark", checkMark);
                                            bundle.putInt("finishMark", finishMark);
                                            bundle.putInt("faceRecgMark", faceRecgMark);
                                            bundle.putString("photoUrl", photoUrl);
                                            bundle.putInt("chNo", chNo);
                                            bundle.putInt("allowMuT", allowMuT);
                                            bundle.putInt("rtype", otpSn);
                                            bundle.putInt("qnSn",qnSn);
                                            if (qpSn == null) {
                                                bundle.putInt("qpSn", 0);
                                            } else {

                                                bundle.putInt("qpSn", qpSn);
                                            }
                                            startActivity(SubSpecifiedLearningHome1Activity .class, bundle);
                                        }
                                    }
                                } else if (tv_specified_learning.getText().toString().equals("开始考试")) {
                                    int sn = rowsBean.getSn();
                                    SharedPreferences sp = getSharedPreferences("SpecifiedLearningHomeActivity",
                                            Context.MODE_PRIVATE);
                                    String orgId = sp.getString("orgId", "");
                                    int faceRecgMark = sp.getInt("faceRecgMark", 0);
                                    String photoUrl = sp.getString("photoUrl", "");
                                    Bundle bundle = new Bundle();
                                    bundle.putString("orgId", orgId);
                                    bundle.putInt("qpSn", qpSn);
                                    bundle.putInt("learnsn", sn);
                                    bundle.putInt("faceRecgMark", faceRecgMark);
                                    bundle.putString("photoUrl", photoUrl);
                                    startActivity(DailyTrainingExaminationItemActivity.class, bundle);
                                }
                            }
                        });


                    }
                }
            }

            img_share.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {

                    LoginUserBean userInfo = UserManger.getUserInfo();
                    LoginUserBean.DataBean data = userInfo.getData();
                    String userName = data.getUserName();
                    showsharepopwindow(chName, userName);

                }
            });


        }

        private void showsharepopwindow(String chName, final String userName) {

            final String chNamestr = chName.substring(0, 8);

            //设置contentView
            View contentView = LayoutInflater.from(SpecifiedLearningHomeActivity.this).inflate(R.layout.popwindow_share_layout, null);
            final PopupWindow mPopWindow = new PopupWindow(contentView,
                    WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT, true);

            ImageView img_wxin = (ImageView) contentView.findViewById(R.id.img_wxin);
            ImageView img_wxinfriend = (ImageView) contentView.findViewById(R.id.img_wxinfriend);
            LinearLayout le_specified = (LinearLayout) contentView.findViewById(R.id.le_specified);
            le_specified.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    mPopWindow.dismiss();
                }
            });
            RelativeLayout re_specified = (RelativeLayout) contentView.findViewById(R.id.re_specified);
            re_specified.setOnClickListener(null);
            mPopWindow.showAtLocation(img_wxin, Gravity.BOTTOM, 0, 0);
            img_wxin.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    mPopWindow.dismiss();

                    /*UMWeb web = new UMWeb(AppInterfaceConfig.ShareUrl);
                    web.setTitle("我" + userName + "正在使用驾运宝，已完成" + chNamestr + "的日常培训！");
                    web.setThumb(new UMImage(SpecifiedLearningHomeActivity.this, R.drawable.logo_share));
                    web.setDescription("驾运宝，专为互联网道路安全教育而生，快来看看吧！");
                    new ShareAction(SpecifiedLearningHomeActivity.this)
                            .withMedia(web)
                            .setPlatform(SHARE_MEDIA.WEIXIN)//传入平台
                            .setCallback(shareListener)//回调监听器
                            .share();*/
                    WechatShareManager mWechatShareManager = WechatShareManager.getInstance(SpecifiedLearningHomeActivity.this);
                    WechatShareManager.ShareContentWebpage mSharePage = (WechatShareManager.ShareContentWebpage) mWechatShareManager.getShareContentWebpag(
                            "我" + userName + "正在使用驾运宝，已完成" + chNamestr + "的日常培训！",
                            "驾运宝，专为互联网道路安全教育而生，快来看看吧！",
                            AppInterfaceConfig.ShareUrl,
                            bitmap);
                    mWechatShareManager.shareByWebchat(mSharePage, WechatShareManager.WECHAT_SHARE_TYPE_TALK);
                }
            });

            img_wxinfriend.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    mPopWindow.dismiss();

                    /*UMWeb web1 = new UMWeb(AppInterfaceConfig.ShareUrl);
                    web1.setTitle("我" + userName + "正在使用驾运宝，已完成" + chNamestr + "的日常培训！");
                    web1.setThumb(new UMImage(SpecifiedLearningHomeActivity.this, R.drawable.logo_share));
                    new ShareAction(SpecifiedLearningHomeActivity.this)
                            .setPlatform(SHARE_MEDIA.WEIXIN_CIRCLE)//传入平台
                            .withMedia(web1)
                            .setCallback(shareListener)//回调监听器
                            .share();*/
                    WechatShareManager mWechatShareManager = WechatShareManager.getInstance(SpecifiedLearningHomeActivity.this);
                    WechatShareManager.ShareContentWebpage mSharePage = (WechatShareManager.ShareContentWebpage) mWechatShareManager.getShareContentWebpag(
                            "我" + userName + "正在使用驾运宝，已完成" + chNamestr + "的日常培训！",
                            "驾运宝，专为互联网道路安全教育而生，快来看看吧！",
                            AppInterfaceConfig.ShareUrl,
                            bitmap);
                    mWechatShareManager.shareByWebchat(mSharePage, WechatShareManager.WECHAT_SHARE_TYPE_FRENDS);
                }
            });


        }


        /* private UMShareListener shareListener = new UMShareListener() {
         *//**
         * @descrption 分享开始的回调
         * @param platform 平台类型
         *//*
            @Override
            public void onStart(SHARE_MEDIA platform) {

            }

            *//**
         * @descrption 分享成功的回调
         * @param platform 平台类型
         *//*
            @Override
            public void onResult(SHARE_MEDIA platform) {

                Toast.makeText(SpecifiedLearningHomeActivity.this, "分享成功", Toast.LENGTH_LONG).show();
            }

            *//**
         * @descrption 分享失败的回调
         * @param platform 平台类型
         * @param t 错误原因
         *//*
            @Override
            public void onError(SHARE_MEDIA platform, Throwable t) {

                if (t.getMessage().contains("没有安装应用")) {
                    Toast.makeText(SpecifiedLearningHomeActivity.this, "没有安装微信应用", Toast.LENGTH_LONG).show();
                } else {

                    Toast.makeText(SpecifiedLearningHomeActivity.this, "分享失败" + t.getMessage(), Toast.LENGTH_LONG).show();
                }
            }

            *//**
         * @descrption 分享取消的回调
         * @param platform 平台类型
         *//*
            @Override
            public void onCancel(SHARE_MEDIA platform) {

                Toast.makeText(SpecifiedLearningHomeActivity.this, "分享取消", Toast.LENGTH_LONG).show();

            }
        };*/

    }
}
